CREATE TABLE [dbo].[ORIGINALES]
(
[ID] [numeric] (10, 0) NOT NULL,
[NRO_ORIGINAL] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ID_DESCRIPCION] [numeric] (10, 0) NOT NULL,
[ID_CATEGORIA] [numeric] (10, 0) NOT NULL,
[FECHA_CREACION] [datetime2] (0) NULL CONSTRAINT [DF_ORIGINALES_FECHA_CREACION] DEFAULT (getdate()),
[COMENTARIO] [varchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL CONSTRAINT [DF_ORIGINALES_COMENTARIO] DEFAULT ('')
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ORIGINALES] ADD CONSTRAINT [PK_ORIGINALES_1] PRIMARY KEY CLUSTERED  ([ID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ORIGINALES] ADD CONSTRAINT [IX_ORIGINALES] UNIQUE NONCLUSTERED  ([NRO_ORIGINAL]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ORIGINALES_CATEGORIAS] ON [dbo].[ORIGINALES] ([ID_CATEGORIA]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ORIGINALES_DESCRIPCIONES] ON [dbo].[ORIGINALES] ([ID_DESCRIPCION]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ORIGINALES] ADD CONSTRAINT [FK_ORIGINALES_CATEGORIAS] FOREIGN KEY ([ID_CATEGORIA]) REFERENCES [dbo].[CATEGORIAS] ([ID])
GO
ALTER TABLE [dbo].[ORIGINALES] ADD CONSTRAINT [FK_ORIGINALES_DESCRIPCIONES] FOREIGN KEY ([ID_DESCRIPCION]) REFERENCES [dbo].[DESCRIPCIONES] ([ID])
GO
